//
//  SAPresonViewController.m
//  SAP
//
//  Created by 中矿科技有限公司 on 17/9/18.
//  Copyright © 2017年 中矿科技有限公司. All rights reserved.
//

#import "SAPresonViewController.h"
#import "SACustomerDetailCell.h"

@interface SAPresonViewController ()<UITableViewDelegate,UITableViewDataSource>

@property(nonatomic,strong)UITableView *tableView;
@property(nonatomic,strong)NSArray *presonArray;

@end
static NSString *const cellID =@"SACustomerDetailCell";
@implementation SAPresonViewController
{
    AFHTTPData *_http;
    
    MBProgressHUD *_waitHud;

    NSDictionary *_detailDict;
    
}

-(UITableView *)tableView{
    if (_tableView) {
        return _tableView;
    }
    _tableView =[[UITableView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-64) style:UITableViewStyleGrouped];
    _tableView.separatorStyle =UITableViewCellSeparatorStyleNone;
    [_tableView registerNib:[UINib nibWithNibName:@"SACustomerDetailCell" bundle:nil] forCellReuseIdentifier:cellID];
    _tableView.showsVerticalScrollIndicator =NO;
    _tableView.showsHorizontalScrollIndicator =NO;
    _tableView.delegate =self;
    _tableView.dataSource =self;
    return _tableView;
}


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    _http =[[AFHTTPData alloc]init];
    _presonArray =@[@[@"登陆名",@"姓名"],@[@"联系电话",@"邮箱"],@[@"所属单位",@"部门",@"岗位"]];
    [self customUI];
    //[self prepareData];
}


-(void)customUI{
    self.title =@"个人信息";
    self.view.backgroundColor =SA_AllBackColor;
    [self.view addSubview:self.tableView];
}
#pragma mark tableView-Delegate

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return _presonArray.count;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return  [_presonArray[section] count];
    
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 49;
    
}

-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return 20.f;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return .1f;
}


-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    SACustomerDetailCell *cell =[tableView dequeueReusableCellWithIdentifier:cellID forIndexPath:indexPath];
    //cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    cell.detailName.text =_presonArray[indexPath.section][indexPath.row];
    [cell setFromUserProfileModelIndexPath:indexPath];
    return cell;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
